package com.xcc.observerpattern;

import com.xcc.observerpattern.demo1.CurrentConditionsDisplay;
import com.xcc.observerpattern.demo1.ForecastDisplay;
import com.xcc.observerpattern.demo1.StatisticsDisplay;
import com.xcc.observerpattern.demo1.WeatherData;

/**
 * @Author: xiechuang
 * @Date: 2022/6/28
 */
public class Demo {

    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData);
        StatisticsDisplay statisticsDispla = new StatisticsDisplay(weatherData);
        ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);
        weatherData.setMeasurements(80, 65, 30.4f);
        weatherData.setMeasurements(82, 70, 29.2f);
        weatherData.setMeasurements(78, 90, 29.2f);

        System.out.println("=== 我是分界线 ===");
        com.xcc.observerpattern.demo2.WeatherData weatherData2 = new com.xcc.observerpattern.demo2.WeatherData();
        com.xcc.observerpattern.demo2.CurrentConditionsDisplay currentConditionsDisplay2 = new com.xcc.observerpattern.demo2.CurrentConditionsDisplay(weatherData2);
        weatherData.setMeasurements(82, 70, 29.2f);
        weatherData.setMeasurements(78, 90, 29.2f);
    }

}
